package com.mazaiting.uac.controller;

import com.mazaiting.uac.domain.vo.CaptchaVO;
import com.mazaiting.uac.service.ICaptchaService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 图形验证码控制器
 *
 * @author mazaiting
 * @create_time 2022/9/26 09:25
 */
@Slf4j
@RestController()
@RequestMapping("uac/v1/captcha")
@RequiredArgsConstructor
public class CaptchaController {

    private final ICaptchaService captchaService;

    /**
     * 获取图形验证码
     * @param t 时间
     * @return 图形验证码
     */
    @GetMapping
    public CaptchaVO get(@RequestParam Long t) {
        return captchaService.get(t);
    }

}
